package com.itheima.HomeWork_day06;
/*
递归: 计算阶乘
 */
public class Recursion {
    public static void main(String[] args) {
        int num=getFactoria(5);
        System.out.println("5的阶乘为:"+num);
    }

    public static int getFactoria(int i) {
        //判断方法出口
        if (i==1){
            return 1;
        }else{
          return  i*getFactoria(i-1);
        }

    }


}
